package com.hg.chapter82.repository;

import com.hg.chapter82.entity.People;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Optional;

@Transactional
public interface PeopleRepository extends JpaRepository<People,Long> {

    List<People> findAllByName(String name);

    Optional<People> findById(Long id);

    //int removeById(Long id);

    int countAllByAge(int age);

    //List<People> getAll();

}
